int StrToInt(const char *str)
{
    int i = 0, result = 0;
    while(str[i] != 0)
    {
        result *= 26;
        result += str[i] - 'A' + 1;
        i ++;
    }
    return result;
}
#include <iostream>
int main()
{
    std::cout << "AA: " << StrToInt("AA");
}
